#pragma once
#include<iostream>
#include<string>
#include<vector>

class Util
{
public:
    //目标字符串  分隔符  vector
    static void StrSplit(const std::string&str,std::string sep,std::vector<std::string>&res)
    {
        size_t start=0;
        while(start<str.size())
        {
            auto pos=str.find(sep,start);
            if(pos==std::string::npos) break;
            res.push_back(str.substr(start,pos-start));
            start=pos+sep.size();
        }
        if(start<str.size())
            res.push_back(str.substr(start));
    }

    static int ToInt(std::string str)
    {
        return atoi(str.c_str());
    }
};